package com.netbetter.langzheng.plugin.fileManager.reader;

import com.netbetter.langzheng.plugin.fileManager.data.FileManagerRequest;
import com.netbetter.langzheng.plugin.fileManager.dto.CommandDTO;
import com.netbetter.langzheng.plugin.fileManager.model.CommandResultModel;

/**
 * @author 嘉陵江里捉鱼 email:tang7259@163.com
 *@version 1.0
 *@time 2008-9-16 下午08:35:25
 */
public class CommandReader {

    public static CommandResultModel exce(CommandDTO command, CommandRequestCallback callback) {
        CommandResultModel result = new CommandResultModel();
        try {
            FileManagerRequest.exceCommand(command).sendRequest(null, callback);
            result.setSuccess(true);
        } catch (Exception error) {
            result.setSuccess(false);
            result.setMessage(error.getMessage());
        }
        return result;
    }
}
